Optimal. Leaf size=114 \[ \frac {x}{4 a^2}+\frac {i a}{12 d (a+i a \tan (c+d x))^3}+\frac {i}{8 d (a+i a \tan (c+d x))^2}-\frac {i}{16 d \left (a^2-i a^2 \tan (c+d x)\right )}+\frac {3 i}{16 d \left (a^2+i a^2 \tan (c+d x)\right )} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.07, antiderivative size = 114, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 3, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {3568, 46, 212}
\begin {gather*} -\frac {i}{16 d \left (a^2-i a^2 \tan (c+d x)\right )}+\frac {3 i}{16 d \left (a^2+i a^2 \tan (c+d x)\right )}+\frac {x}{4 a^2}+\frac {i a}{12 d (a+i a \tan (c+d x))^3}+\frac {i}{8 d (a+i a \tan (c+d x))^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 46
Rule 212
Rule 3568
Rubi steps
\begin {align*} \int \frac {\cos ^2(c+d x)}{(a+i a \tan (c+d x))^2} \, dx &=-\frac {\left (i a^3\right ) \text {Subst}\left (\int \frac {1}{(a-x)^2 (a+x)^4} \, dx,x,i a \tan (c+d x)\right )}{d}\\ &=-\frac {\left (i a^3\right ) \text {Subst}\left (\int \left (\frac {1}{16 a^4 (a-x)^2}+\frac {1}{4 a^2 (a+x)^4}+\frac {1}{4 a^3 (a+x)^3}+\frac {3}{16 a^4 (a+x)^2}+\frac {1}{4 a^4 \left (a^2-x^2\right )}\right ) \, dx,x,i a \tan (c+d x)\right )}{d}\\ &=\frac {i a}{12 d (a+i a \tan (c+d x))^3}+\frac {i}{8 d (a+i a \tan (c+d x))^2}-\frac {i}{16 d \left (a^2-i a^2 \tan (c+d x)\right )}+\frac {3 i}{16 d \left (a^2+i a^2 \tan (c+d x)\right )}-\frac {i \text {Subst}\left (\int \frac {1}{a^2-x^2} \, dx,x,i a \tan (c+d x)\right )}{4 a d}\\ &=\frac {x}{4 a^2}+\frac {i a}{12 d (a+i a \tan (c+d x))^3}+\frac {i}{8 d (a+i a \tan (c+d x))^2}-\frac {i}{16 d \left (a^2-i a^2 \tan (c+d x)\right )}+\frac {3 i}{16 d \left (a^2+i a^2 \tan (c+d x)\right )}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.34, size = 95, normalized size = 0.83 \begin {gather*} \frac {i \sec ^2(c+d x) (-9+(-3+12 i d x) \cos (2 (c+d x))+\cos (4 (c+d x))+3 i \sin (2 (c+d x))-12 d x \sin (2 (c+d x))+2 i \sin (4 (c+d x)))}{48 a^2 d (-i+\tan (c+d x))^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.82, size = 88, normalized size = 0.77
method | result | size |
risch | \(\frac {x}{4 a^{2}}+\frac {i {\mathrm e}^{-4 i \left (d x +c \right )}}{16 a^{2} d}+\frac {i {\mathrm e}^{-6 i \left (d x +c \right )}}{96 a^{2} d}+\frac {5 i \cos \left (2 d x +2 c \right )}{32 a^{2} d}+\frac {7 \sin \left (2 d x +2 c \right )}{32 a^{2} d}\) | \(79\) |
derivativedivides | \(\frac {-\frac {i \ln \left (\tan \left (d x +c \right )-i\right )}{8}-\frac {i}{8 \left (\tan \left (d x +c \right )-i\right )^{2}}-\frac {1}{12 \left (\tan \left (d x +c \right )-i\right )^{3}}+\frac {3}{16 \left (\tan \left (d x +c \right )-i\right )}+\frac {i \ln \left (\tan \left (d x +c \right )+i\right )}{8}+\frac {1}{16 \tan \left (d x +c \right )+16 i}}{d \,a^{2}}\) | \(88\) |
default | \(\frac {-\frac {i \ln \left (\tan \left (d x +c \right )-i\right )}{8}-\frac {i}{8 \left (\tan \left (d x +c \right )-i\right )^{2}}-\frac {1}{12 \left (\tan \left (d x +c \right )-i\right )^{3}}+\frac {3}{16 \left (\tan \left (d x +c \right )-i\right )}+\frac {i \ln \left (\tan \left (d x +c \right )+i\right )}{8}+\frac {1}{16 \tan \left (d x +c \right )+16 i}}{d \,a^{2}}\) | \(88\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.37, size = 65, normalized size = 0.57 \begin {gather*} \frac {{\left (24 \, d x e^{\left (6 i \, d x + 6 i \, c\right )} - 3 i \, e^{\left (8 i \, d x + 8 i \, c\right )} + 18 i \, e^{\left (4 i \, d x + 4 i \, c\right )} + 6 i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i\right )} e^{\left (-6 i \, d x - 6 i \, c\right )}}{96 \, a^{2} d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.21, size = 189, normalized size = 1.66 \begin {gather*} \begin {cases} \frac {\left (- 24576 i a^{6} d^{3} e^{14 i c} e^{2 i d x} + 147456 i a^{6} d^{3} e^{10 i c} e^{- 2 i d x} + 49152 i a^{6} d^{3} e^{8 i c} e^{- 4 i d x} + 8192 i a^{6} d^{3} e^{6 i c} e^{- 6 i d x}\right ) e^{- 12 i c}}{786432 a^{8} d^{4}} & \text {for}\: a^{8} d^{4} e^{12 i c} \neq 0 \\x \left (\frac {\left (e^{8 i c} + 4 e^{6 i c} + 6 e^{4 i c} + 4 e^{2 i c} + 1\right ) e^{- 6 i c}}{16 a^{2}} - \frac {1}{4 a^{2}}\right ) & \text {otherwise} \end {cases} + \frac {x}{4 a^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.57, size = 103, normalized size = 0.90 \begin {gather*} -\frac {-\frac {6 i \, \log \left (\tan \left (d x + c\right ) + i\right )}{a^{2}} + \frac {6 i \, \log \left (\tan \left (d x + c\right ) - i\right )}{a^{2}} + \frac {3 \, {\left (2 i \, \tan \left (d x + c\right ) - 3\right )}}{a^{2} {\left (\tan \left (d x + c\right ) + i\right )}} + \frac {-11 i \, \tan \left (d x + c\right )^{3} - 42 \, \tan \left (d x + c\right )^{2} + 57 i \, \tan \left (d x + c\right ) + 30}{a^{2} {\left (\tan \left (d x + c\right ) - i\right )}^{3}}}{48 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 3.47, size = 71, normalized size = 0.62 \begin {gather*} \frac {x}{4\,a^2}-\frac {\frac {{\mathrm {tan}\left (c+d\,x\right )}^3\,1{}\mathrm {i}}{4}+\frac {{\mathrm {tan}\left (c+d\,x\right )}^2}{2}-\frac {\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}{12}+\frac {1}{3}}{a^2\,d\,{\left (1+\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}\right )}^3\,\left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________